#include "BoundingSphere.hpp"

BoundingSphere::BoundingSphere(MVector3D& center, float& fRadius)
{
	m_fRadius = fRadius;
	m_center = center;
}

const float& BoundingSphere::getRadius() const
{
	return m_fRadius;
}

const MVector3D& BoundingSphere::getCenter() const
{
	return m_center;
}

bool BoundingSphere::queryCollision(BoundingSphere *pBSphere)
{
	MVector3D centersDist = m_center - const_cast<MVector3D&>(pBSphere->getCenter());

	if(centersDist.GetLength() > (m_fRadius + pBSphere->getRadius()))
		return false;

	return true;
}

//EOF
